package com.atguigu.cloud.controller;

import com.atguigu.cloud.apis.PayFeignApi;
import com.atguigu.cloud.entities.PayDTO;
import com.atguigu.cloud.resp.ResultData;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author bairimengchang
 * @version 1.0
 * @project cloud2024
 * @description 消费者80通过网关调用支付服务8001
 * @date 2024/10/26
 */
@RestController
public class OrderGateWayController
{
    @Resource
    private PayFeignApi payFeignApi;

    @GetMapping(value = "/feign/pay/gateway/get/{id}")
    public ResultData<PayDTO> getById2(@PathVariable("id") Integer id)
    {
        System.out.println("feign调用网关，获取支付信息");
        return payFeignApi.getById2(id);
    }

    @GetMapping(value = "/feign/pay/gateway/info")
    public ResultData<String> getGatewayInfo()
    {
        return payFeignApi.getGatewayInfo();
    }

    @GetMapping(value = "/feign/pay/gateway/filter")
    public ResultData<String> getGatewayFilter()
    {
        return payFeignApi.getGatewayFilter();
    }
}
